<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <form name="editForm" role="form" novalidate v-on:submit.prevent="save()">
        <h2
          id="jhipsterserverApp.userAccount.home.createOrEditLabel"
          data-cy="UserAccountCreateUpdateHeading"
          v-text="$t('jhipsterserverApp.userAccount.home.createOrEditLabel')"
        >
          Create or edit a UserAccount
        </h2>
        <div>
          <div class="form-group" v-if="userAccount.id">
            <label for="id" v-text="$t('global.field.id')">ID</label>
            <input type="text" class="form-control" id="id" name="id" v-model="userAccount.id" readonly />
          </div>
          <div class="form-group">
            <label class="form-control-label" v-text="$t('jhipsterserverApp.userAccount.head')" for="user-account-head">Head</label>
            <input
              type="text"
              class="form-control"
              name="head"
              id="user-account-head"
              data-cy="head"
              :class="{ valid: !$v.userAccount.head.$invalid, invalid: $v.userAccount.head.$invalid }"
              v-model="$v.userAccount.head.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" v-text="$t('jhipsterserverApp.userAccount.nickname')" for="user-account-nickname"
              >Nickname</label
            >
            <input
              type="text"
              class="form-control"
              name="nickname"
              id="user-account-nickname"
              data-cy="nickname"
              :class="{ valid: !$v.userAccount.nickname.$invalid, invalid: $v.userAccount.nickname.$invalid }"
              v-model="$v.userAccount.nickname.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" v-text="$t('jhipsterserverApp.userAccount.birthday')" for="user-account-birthday"
              >Birthday</label
            >
            <input
              type="text"
              class="form-control"
              name="birthday"
              id="user-account-birthday"
              data-cy="birthday"
              :class="{ valid: !$v.userAccount.birthday.$invalid, invalid: $v.userAccount.birthday.$invalid }"
              v-model="$v.userAccount.birthday.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" v-text="$t('jhipsterserverApp.userAccount.login')" for="user-account-login">Login</label>
            <input
              type="text"
              class="form-control"
              name="login"
              id="user-account-login"
              data-cy="login"
              :class="{ valid: !$v.userAccount.login.$invalid, invalid: $v.userAccount.login.$invalid }"
              v-model="$v.userAccount.login.$model"
            />
          </div>
          <div class="form-group">
            <label class="form-control-label" v-text="$t('jhipsterserverApp.userAccount.introduction')" for="user-account-introduction"
              >Introduction</label
            >
            <input
              type="text"
              class="form-control"
              name="introduction"
              id="user-account-introduction"
              data-cy="introduction"
              :class="{ valid: !$v.userAccount.introduction.$invalid, invalid: $v.userAccount.introduction.$invalid }"
              v-model="$v.userAccount.introduction.$model"
            />
          </div>
        </div>
        <div>
          <button type="button" id="cancel-save" class="btn btn-secondary" v-on:click="previousState()">
            <font-awesome-icon icon="ban"></font-awesome-icon>&nbsp;<span v-text="$t('entity.action.cancel')">Cancel</span>
          </button>
          <button
            type="submit"
            id="save-entity"
            data-cy="entityCreateSaveButton"
            :disabled="$v.userAccount.$invalid || isSaving"
            class="btn btn-primary"
          >
            <font-awesome-icon icon="save"></font-awesome-icon>&nbsp;<span v-text="$t('entity.action.save')">Save</span>
          </button>
        </div>
      </form>
    </div>
  </div>
</template>
<script lang="ts" src="./user-account-update.component.ts"></script>
